package com.dayuanit.dy17.atm.atmbackoffice.controller;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class PageController {

    @Autowired
    private RedisTemplate redisTemplate;

    @RequestMapping("/vue/toVueTest")
    public String toVueTest() {
        return "testVue";
    }

    @RequestMapping("/page/toAddUser")
    public String toAddUser() {
        return "addUser";
    }

    @RequestMapping("/page/toAddRole")
    public String toAddRole() {
        return "addRole";
    }

    @RequestMapping("/page/toUserRole")
    public String toUserRole() {
        return "addUserRole";
    }

    @RequestMapping("/page/toAddPower")
    public String toAddPower() {
        return "addPower";
    }

    @RequestMapping("/page/toRolePower")
    public String toRolePower() {
        return "addRolePower";
    }

    @RequestMapping("/page/toLogin")
    public String toLogin() {
        redisTemplate.opsForValue().set("username", "toLogin");
        return "login";
    }

    @RequestMapping("/page/toSalary")
    public String toSalary() {
        return "salary";
    }

    @RequestMapping("/page/toUnauthorized")
    public String toUnauthorized() {
        return "unauthorized";
    }
}
